#ifndef __Math__SplashManager__
#define __Math__SplashManager__

#include "cocos2d.h"
#include "ui/CocosGUI.h"
#include <cocostudio/CocoStudio.h>
USING_NS_CC;
using namespace ui;
class SplashManager : public Layer
{
private:
	Size m_screenSize;
	Node* layerCaution;
	Node* layerDesigner;
	Node* layerLoading;
	LoadingBar* m_loadingBar;	

	bool m_onCautionLayer;
	void setOnCautionLayer();

	//random value run for loading bar
	int m_random;
	float m_valueEachFrame;

	void runLayerDesign();
	void runLayerCaution();

	void initBackground();
	void initLayer();
	void initComponent();
	void tapOK(Ref* pSender);

	void loadResouce();
    virtual void onExit();
	virtual void update(float dt);
	virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event);
public:
    ~SplashManager();
    
	void initalize();
	static Scene* createScene();
	virtual bool init();
	CREATE_FUNC(SplashManager);
};

#endif /* defined(__Math__SplashManager__) */